import React from "react";
import { Tabs } from "antd-mobile";
import { StickyContainer, Sticky } from 'react-sticky';
import { getshopOrder } from '../../../apis/shop'
import LoadMore from '../../../common/loadMore'
import OrderList from './components/orderList';
import { ScollListRow0ul } from './style';
const tabs = [
    { title: "全部", type: 0 },
    { title: "待支付", type: 1 },
    { title: "代发货", type: 2 },
    { title: "待收货", type: 3 },
    { title: "待评论", type: 4 },
];
function renderTabBar(props) {
    return (<Sticky>
        {({ style }) => <div style={{ ...style, zIndex: 1 }}><Tabs.DefaultTabBar {...props} /></div>}
    </Sticky>);
}
function NewsList(props) {
    return (
        <StickyContainer>
            <Tabs tabs={tabs} onTabClick={props.onTabClick} renderTabBar={renderTabBar}>
                {tabs.map(i => {
                    let type = Number(i.type)
                    return <ScollListRow0ul key={type}>
                        <LoadMore {...props} params={{ type }} ShowListUl={OrderList} httpDatas={getshopOrder} />
                    </ScollListRow0ul>
                })}
            </Tabs>
        </StickyContainer>
    );
}
export default NewsList;
